<div class="x-body">
            <form class="layui-form" method="post" action="{:U('admin/goods/addattr')}">

                <?php foreach ($attrs as  $attr) { ?>
                    
                
                 <div class="layui-form-item">
                    <label class="layui-form-label"><?php echo $attr['attr_name'] ?></label>
                    <div class="layui-input-block">
                        <?php foreach ($attr['attr_value'] as $v) { ?>
                            
                        
                      <input type="checkbox" name="attr[<?php echo $attr['attr_id'] ?>][]" value="<?php echo $v ?>" title="<?php echo $v ?>" <?php if(in_array($v,$attrArr)){ echo "checked";} ?> >
                      <?php } ?>
                    </div>
                </div>
                <?php } ?>
                <div class="layui-form-item">
                    <input type="hidden" value="<?php echo $_GET['id'] ?>" name="good_id">
                    <label for="L_repass" class="layui-form-label">
                    </label>
                    <input type="submit"  class="layui-btn" value="增加">
                </div>
            </form>
        </div>
        <script src="./lib/layui/layui.js" charset="utf-8">
        </script>
        <script src="./js/x-layui.js" charset="utf-8">
        </script>
        <script>
            layui.use(['form','layer'], function(){
                $ = layui.jquery;
              var form = layui.form()
              ,layer = layui.layer;
              
            });
        </script>